#pragma once
#include <iostream>
#include <unistd.h>
#include <vector>
using namespace std;
typedef void (*func)();
void Print()
{
    cout <<"pid:"<<getpid()<<",打印功能正在执行" << endl;
}

void Vs()
{
    cout << "Vs功能正在执行" << endl;
}

void Mysql()
{
    cout << "Mysql功能正在执行" << endl;
}
class Task
{
public:
    Task()
    {
        v.push_back(Print);
        v.push_back(Mysql);
        v.push_back(Vs);
    }
    void Executive(int &command)
    {
        if (command >= 0 && command < v.size())
        {
            v[command]();
        }
    }

private:
    vector<func> v;
};


